package com.sc.ktapplication.module.activity

import android.app.Application
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.sc.ktapplication.common.base.BaseViewModel
import com.sc.ktapplication.common.constant.AppConstant
import kotlinx.coroutines.launch

class FeedbackViewModel(application: Application) : BaseViewModel(application) {

    val saveRet = MutableLiveData<Boolean>()

    fun saveFeedback(param : HashMap<String,Any>) {
        viewModelScope.launch {
            try {
                val ret = webApi.login(param)
                if(ret.isSuccess){
                    saveRet.postValue(true)
                }else{
                    saveRet.postValue(false)
                }
            }catch (e :Exception){
                errorMsg.postValue(AppConstant.NET_ERROR)
            }
        }
    }

}